<?php

namespace application\index\controller;

use think\Config;
use think\Controller;
use think\Db;

class IndexController extends Controller {

    public function index() {
        Db::name('replyset')->where('reply_set_id','1')->setInc('reply_num',1);
die();
        echo Config::get('web_url');
        echo 'index.2';
         $usr = array (
            'subscribe' => 1,
            'openid' => 'o2HBzv0Od6Vy7pdVPASgpSSzmdYQ',
            'nickname' => '東',
            'sex' => 1,
            'language' => 'zh_CN',
            'city' => '达尔文',
            'province' => '北部地区',
            'country' => '澳大利亚',
            'headimgurl' => 'http://thirdwx.qlogo.cn/mmopen/ChCs6YSVOGXLJFX7SicTXWVAER2M8iazqayKoiaSjfcuibgiao6OazHJoZJ6ulT73ffHpOye8V0x92BwDMPeibtpV5bg/132',
            'subscribe_time' => 1581303191,
            'unionid' => 'ojl8k0uVxqXmz_0DP6zcVRz673sA',
            'remark' => '',
            'groupid' => 0,
            'tagid_list' =>
                array (
                ),
            'subscribe_scene' => 'ADD_SCENE_QR_CODE',
            'qr_scene' => 0,
            'qr_scene_str' => 'hello',
        );
        $arr['openid'] = $usr['openid'];
        $arr['nickname'] = $usr['nickname'];
        $arr['sex'] = $usr['sex'];
        $arr['city'] = $usr['city'];
        $arr['province'] = $usr['province'];
        $arr['country'] = $usr['country'];
        $arr['headimgurl'] = $usr['headimgurl'];
        $arr['subscribe_time'] = date('Y-m-d H:i:s',$usr['subscribe_time']);
        $arr['from_qr'] = $usr['qr_scene_str'];
        $arr['status'] = 1;
       echo  Db::name('qrmember')->fetchSql(true)->insert($arr);
        echo DB('qrmember')->getLastSql();
    }

    public function test() {
        /**
        $t = new \my\Test();
        $t->t();
        import('my2/Test', EXTEND_PATH);
        $t2 = new \Test();
        $t2->t();
        dump(config());
        dump(url('index/blog/read?id=5'));
         * 
         */
        import('phpqrcode/phpqrcode',EXTEND_PATH);
        
        \QRcode::png("php"); 
        
        
    }
    
    public function test2(){
        echo '<img src="http://admin.0532888.co/index/index/test">';
    }
    public function hello(){
        echo $id = $this->request->param('id');
        echo '2';
    }
}
